package com.gs.SynAntiWandering.control;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;

import com.gs.SynAntiWandering.R;
import com.gs.SynAntiWandering.util.ImageUtil;

public class LabelPhoto extends LinearLayout {
    private CircleImageView iv;
    private Context context;

    public LabelPhoto(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        this.context = context;
        LayoutInflater.from(context).inflate(R.layout.label_photo, this, true);
        iv = findViewById(R.id.ivUserLogo);
    }

    public void setImageResource(int id) {
        iv.setImageResource(id);
    }

    public void loadPic(String url) {
        ImageUtil.getInstance().loadPersonImg(context, url, iv);
    }
}
